home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Essentials / Developer Essentials Nov 90 / International System⁄HyperCard / KanjiTalk Toolkit / Sample Code / DiskFdef / FdefHeader.a < prev    next >
Encoding:
Text File  |  1990-09-14  |  2.3 KB  |  87 lines  |  [TEXT/MPS ]

  1. ; File FdefHeader.a
  2. ; -----------------------------------------------------------------------------
  3. ; Header generate program and utility routine for sample  FDEF of KanjiTalk .
  4. ;
  5. ; Copyright Apple Computer, Inc. 1987-89.
  6. ; All Rights Reserved.
  7. ; Written by H.Takahashi
  8. ;
  9. ;  updated to second version.  jwc 10/25/89
  10. ;    900126 cjw    Moved FDEFDispatch from before "bra.s    @0"
  11. ;            to present position to help linker reduce size 
  12. ;            of generated object
  13. ; -----------------------------------------------------------------------------
  14.  
  15.     Proc
  16.     Blanks    On
  17.     String    Asis
  18.     
  19. FDEFDispatch MAIN EXPORT 
  20.  
  21.     import    OpenFDEF    
  22.     import    CloseFDEF    
  23.  
  24.     import    NewFbit        
  25.     import    DisposeFbit    
  26.     import    OpenFbit    
  27.     import    CloseFbit    
  28.     import    ReadyFbit    
  29.     
  30.     import    GetChar        
  31.     import    SetChar        
  32.     import    AddChar        
  33.     import    DelChar    
  34.     export    SETFISERROR    
  35.  
  36. fdefIDDisk    equ    7        ; On demand Disk access fdef.
  37. fdefVersDisk    equ    1        ; second version. (GCC)
  38.  
  39.     bra.s    @0                ; skip header.
  40.     dc.l    'fdef'                ; resource type.
  41.     dc.w    fdefIDDisk            ; resource id.
  42.     dc.w    fdefVersDisk            ; version number.
  43.     dc.w    1<<14                ; Can make new fbit.
  44.  
  45. @0    move.l    (sp)+,a0            ; pop the return address.
  46.     move.w    (sp)+,d0            ; pop the selector.
  47.     move.l    a0,-(sp)            ; push the return address.
  48.     lea    offsetTable,a0            ; get the offset table pointer.
  49.     move.w    0(a0,d0.w),d0            ; Load the offset.
  50.     jmp    0(a0,d0.w)            ; jump to the routine.
  51.  
  52. ; The offset table is indexed by a font package selector and each entry is
  53. ; the offset to the proper routine from the beginning of the table.
  54.  
  55. offsetTable
  56.     dc.w    OpenFDEF    - offsetTable
  57.     dc.w    CloseFDEF    - offsetTable
  58.  
  59.     dc.w    NewFbit        - offsetTable
  60.     dc.w    DisposeFbit    - offsetTable
  61.     dc.w    OpenFbit    - offsetTable
  62.     dc.w    CloseFbit    - offsetTable
  63.     dc.w    ReadyFbit    - offsetTable
  64.     
  65.     dc.w    GetChar        - offsetTable
  66.     dc.w    SetChar        - offsetTable
  67.     dc.w    AddChar        - offsetTable
  68.     dc.w    DelChar        - offsetTable
  69.  
  70. ; ----------------------------------------------------------------------------
  71. ; Routine    SetFISError(theError: Integer);
  72. ; Input        sp.w    New value for FISError.
  73. ; Output
  74. ; Function    Simple little routine to set the current value of FISError.
  75. ; ----------------------------------------------------------------------------
  76.  
  77. SETFISERROR
  78.     movea.l    $ba0,a0
  79.     movea.l    $76(a0),a0
  80.     move.l    (sp)+,a1            ; pop return address.
  81.     move.w    (sp)+,$74(a0)            ; set FIS error value.
  82.     jmp    (a1)                ; return to the caller.
  83.  
  84.  
  85.     EndP
  86.     End
  87.